﻿using System;
using System.Collections.Generic;
using System.Text;

namespace daSyntaxAnalyser.SyntaxTree
{
    using daBase.Objects;

    public class ExportsElementElement : IdElement
    {
        private ExportByElement option;

        public ExportByElement Option { get { return option; } set { option = value; } }

        public ExportsElementElement(TokenInfo Id, ExportByElement Option, List<TokenInfo> Comments)
            : base(Id, Comments)
        {
            option = Option;
        }

        public override string ToString()
        {
            return string.Format("{0}{1}", base.ToString(), (option != null) ? string.Format(" {0}", option) : string.Empty);
        }

        protected override IEnumerator<ISyntaxTreeElement> CreateEnumerator()
        {
            if (option != null)
                yield return option;
        }
    }
}
